package com.feeyo.groundservice.recordnfc.model

import com.feeyo.groundservice.recordnfc.constant.AttachResourceType

/**
 *作者：70893 on 2025-10-13
 *描述：
 */


/**
 * 日志
 * {
"id": 2,
"category": 1,
"iata": "SHE",
"nfc": "",
"title": "002",
"long_id": 1,
"username": "",
"nfc_type": "",
"estatus": 1,
"created_time": 1760319320,
"updated_time": 1760319320
 * }
 *
 * **/

internal data class NfcBindBO(
    val data: List<NfcBindItemBO>,

    //需要提前处理到内部
    val car: List<NfcCarBO>?,
    val user: List<NfcUserBO>?,
    val parking: List<TaskConfigBO>?

)

internal data class NfcBindItemBO(
    val id: String,
    val category: Int,//0：不限 1:机位 2:登机口
    val title: String,//机位 登机口名称
    val long_id: String,//对应资源的id，匹配使用的
    val nfc: String,
    val username: String,//录入人
    val nfc_type: String,// user  car  task
    val updated_time: Long,

    //被操作的对象
    var car: NfcCarBO?,
    var user: NfcUserBO?,
    var parking: TaskConfigBO?
) {
    val personName: String
        get() = user?.let { "${it.truename}" } ?: ""

    val carNum: String
        get() = car?.title ?: ""

    val taskName: String
        get() = parking?.title ?: ""

    val taskLinkName: String
        get() = AttachResourceType.getType(category).title + " $title"
}